package com.block.datapush.service.apipush.utils;

import cn.hutool.core.util.StrUtil;
import com.block.common.enums.BaseTypeInfoEnum;

/**
 * 81 大麦花花  回调
 */
public class DaMaiHuiUtil {

    //贷款期限
    public static Integer getLoanAmount(String loanAmount) {
        if (StrUtil.equals(loanAmount, BaseTypeInfoEnum.LoanAmount.la001.getValue())) {
            return 2;
        } else if (StrUtil.equals(loanAmount, BaseTypeInfoEnum.LoanAmount.la002.getValue())) {
            return 3;
        } else if (StrUtil.equals(loanAmount, BaseTypeInfoEnum.LoanAmount.la003.getValue())) {
            return 4;
        }
        return 5;
    }

    //贷款时间
    public static Integer getLoanTerm(String loanTime) {
        if (StrUtil.equals(loanTime, BaseTypeInfoEnum.LoanTime.lt001.getValue())) {
            return 5;
        } else if (StrUtil.equals(loanTime, BaseTypeInfoEnum.LoanTime.lt002.getValue())) {
            return 4;
        } else if (StrUtil.equals(loanTime, BaseTypeInfoEnum.LoanTime.lt003.getValue())) {
            return 3;
        }
        return 2;
    }

    //贷款用途
    public static Integer getLoanUse(String yongtu) {
        if (StrUtil.equals(yongtu, BaseTypeInfoEnum.Yongtu.yt001.getValue())) {
            return 6;
        } else if (StrUtil.equals(yongtu, BaseTypeInfoEnum.Yongtu.yt002.getValue())) {
            return 1;
        } else if (StrUtil.equals(yongtu, BaseTypeInfoEnum.Yongtu.yt003.getValue())) {
            return 2;
        } else if (StrUtil.equals(yongtu, BaseTypeInfoEnum.Yongtu.yt004.getValue())) {
            return 3;
        } else if (StrUtil.equals(yongtu, BaseTypeInfoEnum.Yongtu.yt005.getValue())) {
            return 4;
        }
        return 6;
    }

    //职业身份
    public static Integer getJob(String jbo) {
        if (StrUtil.equals(jbo, BaseTypeInfoEnum.Gongzuo.gz001.getValue())) {
            return 1;
        } else if (StrUtil.equals(jbo, BaseTypeInfoEnum.Gongzuo.gz002.getValue())) {
            return 2;
        } else if (StrUtil.equals(jbo, BaseTypeInfoEnum.Gongzuo.gz003.getValue())) {
            return 3;
        }
        return 1;
    }

    //收入
    public static Integer getShouru(String shouru) {
        if (StrUtil.equals(shouru, BaseTypeInfoEnum.Shouru.sr001.getValue())) {
            return 2;
        } else if (StrUtil.equals(shouru, BaseTypeInfoEnum.Shouru.sr002.getValue())) {
            return 3;
        } else if (StrUtil.equals(shouru, BaseTypeInfoEnum.Shouru.sr003.getValue())) {
            return 4;
        } else if (StrUtil.equals(shouru, BaseTypeInfoEnum.Shouru.sr004.getValue())) {
            return 5;
        }
        return 2;
    }

    //学历
    public static Integer getXueli(String xueli) {
        if (StrUtil.equals(xueli, BaseTypeInfoEnum.XueLi.xl002.getValue())) {
            return 2;
        } else if (StrUtil.equals(xueli, BaseTypeInfoEnum.XueLi.xl003.getValue())) {
            return 3;
        } else if (StrUtil.equals(xueli, BaseTypeInfoEnum.XueLi.xl004.getValue())) {
            return 4;
        } else if (StrUtil.equals(xueli, BaseTypeInfoEnum.XueLi.xl005.getValue())) {
            return 6;
        }
        return 2;
    }

    //芝麻
    public static Integer getZhima(String zhima) {
        if (StrUtil.equals(zhima, BaseTypeInfoEnum.Zhima.zm002.getValue())) {
            return 5;
        } else if (StrUtil.equals(zhima, BaseTypeInfoEnum.Zhima.zm003.getValue())) {
            return 1;
        } else if (StrUtil.equals(zhima, BaseTypeInfoEnum.Zhima.zm004.getValue())) {
            return 2;
        } else if (StrUtil.equals(zhima, BaseTypeInfoEnum.Zhima.zm005.getValue())) {
            return 4;
        }
        return 1;
    }

    //逾期
    public static Integer getYuqi(String yuqi) {
        if (StrUtil.equals(yuqi, BaseTypeInfoEnum.Yuqi.yq001.getValue())) {
            return 1;
        }
        return 3;
    }

    //保险
    public static Integer getBaoxian(String baoxian) {
        if (StrUtil.equals(baoxian, BaseTypeInfoEnum.Baoxian.bx001.getValue())) {
            return 2;
        }
        return 1;
    }

    //房产
    public static Integer getHouse(String house) {
        if (StrUtil.equals(house, BaseTypeInfoEnum.House.hu001.getValue())) {
            return 4;
        }
        return 2;
    }
    //车产
    public static Integer getCar(String car) {
        if (StrUtil.equals(car, BaseTypeInfoEnum.Car.car001.getValue())) {
            return 3;
        }
        return 1;
    }

    //社保和公积金
    public static Integer getShebaoAndGjj(String shebao, String gjj) {
        boolean Shebao = StrUtil.equalsAny(shebao, "sb002", "sb003");
        boolean Gjj = StrUtil.equalsAny(gjj, "gjj002", "gjj003");

        if (Shebao && Gjj) {
            return 1; // 都有
        } else if (Shebao) {
            return 2; // 仅社保
        } else if (Gjj) {
            return 3; // 仅公积金
        }
        return 4; // 都没有

    }

    public static void main(String[] args) {
        Integer shebaoAndGjj = getShebaoAndGjj("sb001", "gjj003");
        System.out.println(shebaoAndGjj);

    }


}
